home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_actor_tp_pnch.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
4KB
|
167 lines
# Jedi Knight Cog Script
#
# ACTOR_tp_pnch.COG
#
# ACTOR SCRIPT - Tie Pilot
#
# [CYW, YB, CR, SRS]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
message killed
message damaged
message skill
message timer
template powerup=+DSTrifle local
ai flee_ai=noweapon.ai local
ai punch_ai=tp_punch.ai local
int oldAIMode local
int isFrozenNow=0 local
flex extraFreezeTime=0.0 local
int newThing local
int victim local
int bin local
int senderref=-1 local
int damage local
vector currentpos local
end
# ========================================================================================
code
damaged:
damage = GetParam(0);
if(GetParam(1) == 16) // saber does 1.5 times damage
{
damage = (damage * 1.5);
}
ReturnEx(damage);
return;
# ........................................................................................
killed:
victim = GetSenderRef();
// drop a rifle
if (GetActorWeapon (victim, 1) != -1)
{
AmputateJoint(victim, 3);
newThing = CreateThing(powerup, victim);
SetLifeleft(newThing, 200.0);
}
return;
# ........................................................................................
skill:
bin = GetParam(0);
if(bin == 24) // Force Pull
{
// he's a fighter, not a fleer... -srs
senderref = GetSenderRef();
// If he hasn't been pulled yet...
if (GetActorWeapon (senderref, 1) != -1)
{
SetActorWeapon(senderref, 1, -1);
newThing = CreateThing(powerup, GetSenderRef());
SetLifeleft(newThing, 30.0);
AISetClass (senderref, punch_ai);
AISetMode(senderref, 0x4);
ReturnEx(newThing);
}
else
{
// Give the actor a shove towards the player.
currentpos = VectorSub(GetThingPos(GetLocalPlayerThing(), senderref));
currentpos = VectorScale(VectorNorm(currentPos), 250);
ApplyForce(senderref, currentpos);
ReturnEx(-1);
}
//AIFlee(senderref, GetLocalPlayerThing());
Return;
}
else
if(bin == 31) // Force Grip
{
ReturnEx(10); // return base damage that is taken by this actor.
Return;
}
else
if(bin == 34) // Deadly Sight
{
ReturnEx(10); // return base damage that is taken by this actor.
Return;
}
// else
// if(bin == 1035) // Carbonite
// {
// if (!isFrozenNow)
// {
// senderref = GetSenderRef();
// victim = GetParam(2);
//
// isFrozenNow = 1;
// extraFreezeTime = 0.0;
//
// oldAIMode = AIGetMode(victim);
// AISetMode(victim, 0x2000); // Disable the actor's AI.
// AISetMoveThing(victim, victim); // Set the thing as it's own destination so it stops moving.
//
// SetTimerEx(GetParam(1), 1035, victim, 0); // Make an appointment for "Unthawing"
// }
// else
// {
// extraFreezeTime = extraFreezeTime + GetParam(1);
// }
//
// ReturnEx(0);
// return;
// }
ReturnEx(-1);
return;
# ........................................................................................
timer:
senderref = GetSenderRef();
if(GetSenderId() == 1035) // Thaw out
{
victim = GetParam(0);
if (!extraFreezeTime)
{
AIClearMode(victim, 0xFFFFFFFF);
AISetMode(victim, oldAIMode); // Reinstate the actor's AI.
isFrozenNow = 0;
}
else
{
// We've been hit more than once, so we need to extend the freeze time.
SetTimerEx(extraFreezeTime, 1035, victim, 0); // Make an appointment for "Unthawing"
extraFreezeTime = 0.0;
}
}
Return;
end